/*******************************************************************************
* FILE      : fx_types.h                                                       *
* PURPOSE   : declaration of the preprocessor directives supporting the fixed- *
*             and floating-point modes of operation                            *
* AUTHOR    : Yves Vanderperren                                                *
*******************************************************************************/

#ifndef FX_TYPES_H
#define FX_TYPES_H

#include "systemc.h"

#ifdef FINITE
  #define FX_DOUBLE(wl,iwl,q_mode,o_mode)  sc_fixed<wl,iwl,q_mode,o_mode>
  #define UFX_DOUBLE(wl,iwl,q_mode,o_mode) sc_ufixed<wl,iwl,q_mode,o_mode>

  #define FX_FLOAT(wl,iwl,q_mode,o_mode)   sc_fixed<wl,iwl,q_mode,o_mode>
  #define UFX_FLOAT(wl,iwl,q_mode,o_mode)  sc_ufixed<wl,iwl,q_mode,o_mode>

  #define FX_CHAR(q_mode,o_mode)           sc_fixed<8,8,q_mode,o_mode>
  #define UFX_CHAR(q_mode,o_mode)          sc_ufixed<8,8,q_mode,o_mode>

  // architecture dependent! These numbers are valid for Linux platform
  #define FX_INT(iwl,q_mode,o_mode)        sc_fixed<iwl,iwl,q_mode,o_mode>
  #define UFX_INT(iwl,q_mode,o_mode)       sc_ufixed<iwl,iwl,q_mode,o_mode>

  #define FX_SHORT(iwl,q_mode,o_mode)      sc_fixed<iwl,iwl,q_mode,o_mode>
  #define UFX_SHORT(iwl,q_mode,o_mode)     sc_ufixed<iwl,iwl,q_mode,o_mode>

#else
  #define FX_DOUBLE(wl,iwl,q_mode,o_mode)  double
  #define UFX_DOUBLE(wl,iwl,q_mode,o_mode) double

  #define FX_FLOAT(wl,iwl,q_mode,o_mode)   float
  #define UFX_FLOAT(wl,iwl,q_mode,o_mode)  float

  #define FX_CHAR(q_mode,o_mode)           char
  #define UFX_CHAR(q_mode,o_mode)          unsigned char

  #define FX_INT(iwl,q_mode,o_mode)        int
  #define UFX_INT(iwl,q_mode,o_mode)       unsigned int

  #define FX_SHORT(iwl,q_mode,o_mode)      short
  #define UFX_SHORT(iwl,q_mode,o_mode)     unsigned short

#endif

#endif

